import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {   //门卫扫码登记专用登录
    path: '/loginDoorman',
    name: 'loginDoorman',
    component: () => import( '../views/loginDoorman.vue'),
  },
  {  //员工忘带卡登记，门卫专用
    path: '/forgotCardRegister',
    name: 'forgotCardRegister',
    component:  () => import('../views/forgotCardManage/forgotCardRegister.vue')
  },
  {   //登录访客系统
    path: '/loginVisitors',
    name: 'loginVisitors',
    component: () => import( '../views/loginVisitors.vue'),
  },
  {   //登录员工忘带卡管理
    path: '/',
    name: 'loginForgotCardSystem',
    component: () => import( '../views/loginForgotCardSystem.vue'),
  },
  {   //sso登陆验证
    path: '/ssoLoginVerify',
    name: 'ssoLoginVerify',
    component: () => import( '../views/ssoLoginVerify.vue'),
  },
  {   //SSO登陆页
    path: '/ssoLogin',
    name: 'ssoLogin',
    component: () => import( '../views/ssoLogin.vue'),
  },
  {   //SSO验证错误页面
    path: '/singleError',
    name: 'singleError',
    component: () => import( '../views/singleError.vue'),
  },
  { //访客系统首页
    path: '/Home',
    name: 'Home',
    component: () => import( '../views/Home.vue'),
    children:[
      {path: '/visitorDataDisplay',name: 'visitorDataDisplay',component:  () => import('../views/visitorSystem/visitors/visitorDataDisplay.vue')},   //访客实时数据，访客数据展示
      {path: '/visitorDataQuery',name: 'visitorDataQuery',component:  () => import('../views/visitorSystem/visitors/visitorDataQuery.vue')},   //访客数据查询
      {path: '/visitorDetails',name: 'visitorDetails',component:  () => import('../views/visitorSystem/visitors/visitorDetails.vue')},   //访客明细
      {path: '/videoWatchRecord',name: 'videoWatchRecord',component:  () => import('../views/visitorSystem/visitors/videoWatchRecord.vue')},   //视频观看记录
      {path: '/videoUpload',name: 'videoUpload',component:  () => import('../views/visitorSystem/visitors/videoUpload.vue')},   //视频观看记录
      // {path: '/timePeriodConfig',name: 'timePeriodConfig',component:  () => import('../views/visitorSystem/visitors/timePeriodConfig.vue')},   //访客访问时段与启用配置
      {path: '/visitorUnitCount',name: 'visitorUnitCount',component:  () => import('../views/visitorSystem/visitors/visitorUnitCount.vue')},   //访客单位访问统计
      {path: '/visitorPersonsCount',name: 'visitorPersonsCount',component:  () => import('../views/visitorSystem/visitors/visitorPersonsCount.vue')},   //访客单位人次统计
      {path: '/reserveDaysConfig',name: 'reserveDaysConfig',component:  () => import('../views/visitorSystem/visitors/reserveDaysConfig.vue')},   //访客预约天数配置

      {path: '/intervDeptCount',name: 'intervDeptCount',component:  () => import('../views/visitorSystem/visitors/intervDeptCount.vue')},   //被访者部门人次统计
      {path: '/carDetails',name: 'carDetails',component:  () => import('../views/visitorSystem/vehicle/carDetails.vue')},   //车辆进出记录
      {path: '/carPresenceStatistics',name: 'carPresenceStatistics',component:  () => import('../views/visitorSystem/vehicle/carPresenceStatistics.vue')},   //车辆在场查询
      {path: '/carDataShow',name: 'carDataShow',component:  () => import('../views/visitorSystem/vehicle/carDataShow.vue')},   //车辆实时数据
      {path: '/carDataQuery',name: 'carDataQuery',component:  () => import('../views/visitorSystem/vehicle/carDataQuery.vue')},   //车辆数据查询
      {path: '/carParkManage',name: 'carParkManage',component:  () => import('../views/visitorSystem/vehicle/carParkManage.vue')},   //停车场系统——车辆信息汇总
      {path: '/plateManage',name: 'plateManage',component:  () => import('../views/visitorSystem/parking/plateManage.vue')},   //停车场系统——员工注册记录
      {path: '/logManage',name: 'logManage',component:  () => import('../views/visitorSystem/parking/logManage.vue')},   //停车场系统——员工注册日志记录
      {path: '/workLocationManage',name: 'workLocationManage',component:  () => import('../views/visitorSystem/parking/workLocationManage.vue')},   //停车场系统——工作地点维护
      {path: '/parkingLotManage',name: 'parkingLotManage',component:  () => import('../views/visitorSystem/parking/parkingLotManage.vue')},   //停车场系统——停车场配置
      {path: '/blacklistManage',name: 'blacklistManage',component:  () => import('../views/visitorSystem/parking/blacklistManage.vue')},   //停车场系统——黑名单
      {path: '/specialCarRegisterManage',name: 'specialCarRegisterManage',component:  () => import('../views/visitorSystem/parking/specialCarRegisterManage.vue')},   //停车场系统——特殊车辆注册
      {path: '/purviewGroupDef',name: 'purviewGroupDef',component:  () => import('../views/visitorSystem/purviewManage/purviewGroupDef.vue')},   //权限组定义
      {path: '/adminsDefinitionVisitor',name: 'adminsDefinitionVisitor',component:  () => import('../views/visitorSystem/ruleManage/adminsDefinition')},   //管理员定义
      {path: '/timePeriodConfig',name: 'timePeriodConfig',component:  () => import('../views/visitorSystem/ruleManage/timePeriodConfig')},   //审批人配置
      {path: '/departmentConfig',name: 'departmentConfig',component:  () => import('../views/visitorSystem/ruleManage/departmentConfig')},   //部门配置，南京专用
      {path: '/placeDefinition',name: 'placeDefinition',component:  () => import('../views/visitorSystem/deviceManage/placeDefinition.vue')},   //场所定义
      {path: '/deviceDefinition',name: 'deviceDefinition',component:  () => import('../views/visitorSystem/deviceManage/deviceDefinition.vue')},   //设备定义
      {path: '/departDef',name: 'departDef',component:  () => import('../views/visitorSystem/humanFile/departDef.vue')},   //部门定义
      {path: '/personnelFile',name: 'personnelFile',component:  () => import('../views/visitorSystem/humanFile/personnelFile.vue')},   //人员档案
      {path: '/systemDefinition',name: 'systemDefinition',component:  () => import('../views/visitorSystem/systemSite/systemDefinition.vue')},   //设备定义
      {path: '/logQuery',name: 'logQuery',component:  () => import('../views/visitorSystem/systemSite/logQuery.vue')},   //日志查询
      {path: '/menuManage',name: 'menuManage',component:  () => import('../views/visitorSystem/systemSite/menuManage.vue')},   //菜单管理

      // 忘带卡管理
      // {path: '/forgotCardRegister',name: 'forgotCardRegister',component:  () => import('../views/forgotCardManage/forgotCardRegister.vue')},   //忘带卡登记
      {path: '/forgotCardDetails',name: 'forgotCardDetails',component:  () => import('../views/forgotCardManage/forgotCardDetails.vue')},   //忘带卡明细
      {path: '/forgotCardSummary',name: 'forgotCardSummary',component:  () => import('../views/forgotCardManage/forgotCardSummary.vue')},   //忘带卡汇总
      {path: '/forgotCardRanking',name: 'forgotCardRanking',component:  () => import('../views/forgotCardManage/forgotCardRanking.vue')},   //忘带卡排名
      {path: '/forgotCardBlacklist',name: 'forgotCardBlacklist',component:  () => import('../views/forgotCardManage/forgotCardBlacklist.vue')},   //忘带卡黑名单

    ]
  },
  {   //登录门禁系统
    path: '/loginAccessControl',
    name: 'loginAccessControl',
    component: () => import( '../views/loginAccessControl.vue'),
  },
  {   //门禁系统首页
    path: '/homeAccessControl',
    name: 'homeAccessControl',
    component: () => import( '../views/homeAccessControl.vue'),
    redirect:'/homeSummary',
    children:[
      {path: '/homeSummary',name: 'homeSummary',component:  () => import('../views/accessControlSystem/homeSummary.vue')},     //门禁首页
      {path: '/accessByUser',name: 'accessByUser',component:  () => import('../views/accessControlSystem/authorizeManage/accessByUser.vue')},     //按人授权
      {path: '/accessByDoor',name: 'accessByDoor',component:  () => import('../views/accessControlSystem/authorizeManage/accessByDoor.vue')},     //按门授权
      {path: '/queryByDoor',name: 'queryByDoor',component:  () => import('../views/accessControlSystem/reportQuery/queryByDoor.vue')},          //按门查询进出记录
      {path: '/queryByPeople',name: 'queryByPeople',component:  () => import('../views/accessControlSystem/reportQuery/queryByPeople.vue')},     //按人查询进出记录
      {path: '/queryByDevice',name: 'queryByDevice',component:  () => import('../views/accessControlSystem/reportQuery/queryByDevice.vue')},     //按设备查询进出记录
      {path: '/queryByEquiStatus',name: 'queryByEquiStatus',component:  () => import('../views/accessControlSystem/reportQuery/queryByEquiStatus.vue')},     //设备状态记录查询
      {path: '/queryByOutsider',name: 'queryByOutsider',component:  () => import('../views/accessControlSystem/reportQuery/queryByOutsider.vue')},     //外来人员进出记录
      {path: '/lightFaceManage',name: 'lightFaceManage',component:  () => import('../views/accessControlSystem/faceManage/lightFaceManage.vue')},     //可见光人脸管理
      {path: '/logInquire',name: 'logInquire',component:  () => import('../views/accessControlSystem/faceManage/logInquire.vue')},     //日志查询
      {path: '/placesDefinition',name: 'placesDefinition',component:  () => import('../views/accessControlSystem/deviceManage/placesDefinition.vue')},     //场所定义
      {path: '/devicesDefinition',name: 'devicesDefinition',component:  () => import('../views/accessControlSystem/deviceManage/devicesDefinition.vue')},     //设备定义
      {path: '/doorDefinition',name: 'doorDefinition',component:  () => import('../views/accessControlSystem/basicData/doorDefinition.vue')},     //门定义
      {path: '/channelDefinition',name: 'channelDefinition',component:  () => import('../views/accessControlSystem/basicData/channelDefinition.vue')},     //通道定义
      {path: '/timeRule',name: 'timeRule',component:  () => import('../views/accessControlSystem/basicData/timeRule.vue')},     //时段规则
      {path: '/peopleFile',name: 'peopleFile',component:  () => import('../views/accessControlSystem/personnelFile/peopleFile.vue')},     //人员档案
      {path: '/deptDefinition',name: 'deptDefinition',component:  () => import('../views/accessControlSystem/personnelFile/deptDefinition.vue')},     //部门定义
      {path: '/resignManage',name: 'resignManage',component:  () => import('../views/accessControlSystem/personnelFile/resignManage.vue')},     //离职管理

      {path: '/adminsDefinition',name: 'adminsDefinition',component:  () => import('../views/accessControlSystem/ruleManage/adminsDefinition.vue')},     //管理员定义

    ]
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
export default router
